/**
 * 项目名：phms3
 * 日期：    2019-11-23 11:17:07
 * Copyright (c) 2015- HTSC-版权所有
 */

package com.joysuch.wwyt.core.entity;

import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.annotations.Proxy;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;

import static javax.persistence.GenerationType.IDENTITY;

@EntityListeners({AuditingEntityListener.class, AutoSetCommonFieldListener.class})
@Entity
@Table(name = "WWYT_BASE_IMAGE_REPOSITORY")
@SQLDelete(sql = "update WWYT_BASE_IMAGE_REPOSITORY set DELETE_FLAG = '1' where id= ?")
@SQLDeleteAll(sql = "update WWYT_BASE_IMAGE_REPOSITORY set DELETE_FLAG = '1' where id= ?")
@Where(clause = "DELETE_FLAG = '0'")
@Proxy(lazy = false)
public class BaseImageRepository implements java.io.Serializable {

    // columns START
    // ID
    private java.lang.Long id;
    // 缩略图路径
    private java.lang.String thumbnailPath;
    // 租户
    private java.lang.Long tenentId;
    // 缩略图宽度
    private java.lang.Integer thumbnailWidth;
    // 缩图图长度
    private java.lang.Integer thumbnailLength;
    // 原图路径
    private java.lang.String originPath;
    // 原图长度
    private java.lang.Integer originLength;
    // 原图宽度
    private java.lang.Integer originWidth;
    // 图题
    private java.lang.String title;
    // 图片说明
    private java.lang.String description;
    // 上传时间
    private java.util.Date uploadTime;
    // 删除标记
    private java.lang.String deleteFlag;
    // 组织机构代码
    private java.lang.String orgCode;
    // columns END
    // 指纹
    private java.lang.String fingerPrint;

    private String uniqueId;

    private boolean locateSync;

    @Column(name = "uniqueId")
    public String getUniqueId() {
        return uniqueId;
    }

    public void setUniqueId(String uniqueId) {
        this.uniqueId = uniqueId;
    }

    @Column(name = "locate_sync")
    public boolean isLocateSync() {
        return locateSync;
    }

    public void setLocateSync(boolean locateSync) {
        this.locateSync = locateSync;
    }

    @Column(name = "FINGER_PRINT", length = 64)
    public String getFingerPrint() {
        return fingerPrint;
    }

    public void setFingerPrint(String fingerPrint) {
        this.fingerPrint = fingerPrint;
    }

    public void setId(java.lang.Long value) {
        this.id = value;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "Id", unique = true, nullable = false)
    public java.lang.Long getId() {
        return this.id;
    }

    @Column(name = "THUMBNAIL_PATH", length = 255)
    public java.lang.String getThumbnailPath() {
        return this.thumbnailPath;
    }

    public void setThumbnailPath(java.lang.String value) {
        this.thumbnailPath = value;
    }

    @Column(name = "TENENT_ID")
    public java.lang.Long getTenentId() {
        return this.tenentId;
    }

    public void setTenentId(java.lang.Long value) {
        this.tenentId = value;
    }

    @Column(name = "THUMBNAIL_WIDTH")
    public java.lang.Integer getThumbnailWidth() {
        return this.thumbnailWidth;
    }

    public void setThumbnailWidth(java.lang.Integer value) {
        this.thumbnailWidth = value;
    }

    @Column(name = "THUMBNAIL_LENGTH")
    public java.lang.Integer getThumbnailLength() {
        return this.thumbnailLength;
    }

    public void setThumbnailLength(java.lang.Integer value) {
        this.thumbnailLength = value;
    }

    @Column(name = "ORIGIN_PATH", length = 255)
    public java.lang.String getOriginPath() {
        return this.originPath;
    }

    public void setOriginPath(java.lang.String value) {
        this.originPath = value;
    }

    @Column(name = "ORIGIN_LENGTH")
    public java.lang.Integer getOriginLength() {
        return this.originLength;
    }

    public void setOriginLength(java.lang.Integer value) {
        this.originLength = value;
    }

    @Column(name = "ORIGIN_WIDTH")
    public java.lang.Integer getOriginWidth() {
        return this.originWidth;
    }

    public void setOriginWidth(java.lang.Integer value) {
        this.originWidth = value;
    }

    @Column(name = "TITLE", length = 50)
    public java.lang.String getTitle() {
        return this.title;
    }

    public void setTitle(java.lang.String value) {
        this.title = value;
    }

    @Column(name = "DESCRIPTION", length = 500)
    public java.lang.String getDescription() {
        return this.description;
    }

    public void setDescription(java.lang.String value) {
        this.description = value;
    }

    @Column(name = "UPLOAD_TIME")
    public java.util.Date getUploadTime() {
        return this.uploadTime;
    }

    public void setUploadTime(java.util.Date value) {
        this.uploadTime = value;
    }

    @Column(name = "DELETE_FLAG", length = 2)
    public java.lang.String getDeleteFlag() {
        return this.deleteFlag;
    }

    public void setDeleteFlag(java.lang.String value) {
        this.deleteFlag = value;
    }

    @Column(name = "ORG_CODE", length = 100)
    public java.lang.String getOrgCode() {
        return this.orgCode;
    }

    public void setOrgCode(java.lang.String value) {
        this.orgCode = value;
    }

    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("id", getId())
                .append("thumbnailPath", getThumbnailPath()).append("tenentId", getTenentId())
                .append("thumbnailWidth", getThumbnailWidth()).append("thumbnailLength", getThumbnailLength())
                .append("originPath", getOriginPath()).append("originLength", getOriginLength())
                .append("originWidth", getOriginWidth()).append("title", getTitle())
                .append("description", getDescription()).append("uploadTime", getUploadTime())
                .append("deleteFlag", getDeleteFlag()).append("orgCode", getOrgCode()).toString();
    }

    public int hashCode() {
        return new HashCodeBuilder().append(getId()).toHashCode();
    }

    public boolean equals(Object obj) {
        if (obj instanceof BaseImageRepository == false)
            return false;
        if (this == obj)
            return true;
        BaseImageRepository other = (BaseImageRepository) obj;
        return new EqualsBuilder().append(getId(), other.getId()).isEquals();
    }
}
